class sumRange{
    constructor(arr){
        this.sums=new Array(arr.length)
        for(let i=0;i<this.sums.length-1;i++){
            this.sums[i+1]=this.sums[i]+arr[i]
        }
    }
    sumRange(i,j){
        if(i===0){
            return this.sums[j]
        }
      return this.sums[j]-this.sums[i-1]
    }
}
